//加载数据
Load();

// 加载数据的方法
function Load() {
	$
			.ajax({
				url : "generator/list",
				dataType : "json",
				success : function(data) {
					var html = "";
					// 结果json串转成对象
					var obj = eval(data.page.list);
					$
							.each(
									obj,
									function(i, result) {
										html += "<tr>"
										html += "<td><div class='checkbox'><label><input type='checkbox'/>"
												+ parseInt(i + 1)
												+ "</label></div></td>"
										html += "<td>" + result['tableName']
												+ "</td>"
										html += "<td>" + result['tableComment']
												+ "</td>"
										html += "<td>" + result['engine']
												+ "</td>"
										html += "<td>" + result['createTime']
												+ "</td>"
										html += "<td><a class='btn btn-sm' href='generator/code?tables="
												+ JSON
														.stringify(result['tableName'])
												+ "' role='button'>生成代码</a></td>"
										html += "</tr>"
									});

					$("#genertorTables").find("tbody").html(html);
				}
			});

}